﻿<%@ Page Title="" Language="C#" MasterPageFile="~/HiredQnA.master" AutoEventWireup="true" CodeBehind="qnaresults.aspx.cs" Inherits="Hired.qnaresults" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" runat="server">
    <style type="text/css">
        .results_header
        {
            float: left;
            margin-top: 10px;
            width: 123px;
            height: 15px;
            background: url(/images/resultsheader.png) no-repeat;
        }
        .gvQuestions
        {
            width: 90%;
            margin: 0 auto;
            padding: 2px;
            text-align: center;
            border-bottom: 1px solid #B8B58A;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainPlaceHolder" runat="server">
    <div class="results_header">
    </div>
    <div class="line-clear"></div>
        <asp:Panel ID="pnlResults" runat="server" style="padding-top: 30px; margin-bottom: 20px;">
        <asp:Panel ID="pnlValid" runat="server">
        <p>You searched for <asp:Label ID="lblSearch" runat="server" Font-Bold="True" /> in 
            the <asp:Label ID="lblCategory" runat="server" Font-Bold="True" /> category.
        <br />Your search returned <asp:Label ID="lblCount" runat="server" 
                Font-Bold="False" /> results.</p>
                <asp:GridView ID="gvResults" runat="server" AutoGenerateColumns="False" 
            CssClass="gvQuestions" AllowPaging="True" CellPadding="10" 
                GridLines="Horizontal">
                    <AlternatingRowStyle BackColor="#CCCCFF" />
                    <Columns>
                        <asp:TemplateField HeaderText="Question title" ItemStyle-Width="65%">
                            <ItemTemplate>
                                <asp:LinkButton ID="lblTitle" runat="server" 
                                    PostBackUrl='<%# "question.aspx?id=" + Eval("QuestionID") %>' 
                                    Text='<%# Eval("Title") %>'></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle Width="65%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Poster" ItemStyle-Width="15%">
                            <ItemTemplate>
                                <asp:LinkButton ID="lblUsername" runat="server" 
                                    PostBackUrl='<%# "viewprofile.aspx?username=" + Eval("Username") %>' 
                                    Text='<%# Eval("Username") %>'></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle Width="15%" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Last answer" ItemStyle-Width="20%">
                            <ItemTemplate>
                                <asp:Label ID="lblLastAnswer" runat="server" 
                                    Text='<%# EvalLastAnswer(Eval("LastAnswer")) %>'></asp:Label>
                                <asp:LinkButton ID="lblLastPoster" runat="server" 
                                    PostBackUrl='<%# "viewprofile.aspx?username=" + EvalLastPoster(Eval("LastPoster")) %>' 
                                    Text='<%# EvalLastPoster(Eval("LastPoster")) %>'></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle Width="20%" />
                        </asp:TemplateField>
                    </Columns>
            <HeaderStyle BackColor="#9933FF" ForeColor="White" HorizontalAlign="Center" />
                    <PagerStyle BackColor="#9900FF" />
            <RowStyle BorderStyle="Outset" HorizontalAlign="Left" VerticalAlign="Middle" />
        </asp:GridView>
        </asp:Panel>
        <asp:Panel ID="pnlInvalid" runat="server">
            <p><asp:Label ID="lblError" runat="server" Text="There was an error trying to search. Please try again." /></p>
        </asp:Panel>
        </asp:Panel>
</asp:Content>
